import React, {Component} from 'react';

class App extends Component {
    a=100
    myRef=React.createRef()//新的
    render() {
        return (
            <div>
                <input type="text" ref="text"/>
                <input type="text" ref={this.myRef}/>
                <button onClick={() => {
                    console.log(1111)
                    console.log(this.refs.text)
                    console.log(this.myRef.current)
                }}>add5
                </button>

                <button onClick={this.aclicjk.bind(this)}>add6
                </button>
            </div>
        );
    }

    aclicjk(){
        console.log(111,this)
        console.log(this.myRef.current)
    }
}

export default App;